<?php
/**
 * Created by PhpStorm.
 * User: hpp
 * Date: 2019/12/6
 * Time: 10:54
 */

namespace api\task\controller;

use think\Controller;
use think\Db;

use api\common\service\CurlService;
use api\common\service\FunctionService;
use api\common\model\RlEtCompanyModel;
use api\common\model\RlBmNodeRelModel;
use api\common\model\RlHiseServiceProjectModel;

/**
 * 数据同步接口
 * Class TaskController
 * @package api\task\controller
 */
class TaskController extends Controller
{


        //同步项目数据
    public function item()
    {
        ini_set('memory_limit','-1');
        set_time_limit(4420);
        //安全验证
        $param = input('param.');
        // $result = $this->cssEncrypt($param);
        // if(!$result)
        // {
            // return json([
            //     "MSG"=>'安全验证失败',
            //     "CODE"=>'S',
            // ]);
        // }
        //获取时间段内修改过的项目
        $start_time = strtotime($param['start_time']);
        $end_time = strtotime($param['end_time']);
        $str = 'update_time<'.$end_time.' AND update_time>'.$start_time;
        
        $rlHiseServiceProjectModel = new RlHiseServiceProjectModel();

        //获取一年以内未进入隐蔽结束的安装单号
        $hise_service_project_arr = $rlHiseServiceProjectModel->field('hise_service_project_id,update_time',true)->where('gczt','<',3)->where('update_time','>',time()-86400*360)->column('azd_id');
        //获取时间段内进入隐蔽结束的安装单号
        $strybjs = 'ycgcwcsj<'.$end_time.' AND ycgcwcsj>'.$start_time;
        $hise_service_project_arr_ycgcwcsj = $rlHiseServiceProjectModel->field('hise_service_project_id,update_time',true)->where($strybjs)->column('azd_id');
        
        $hise_service_project_arr = array_merge($hise_service_project_arr,$hise_service_project_arr_ycgcwcsj);
        $hise_service_pro_cont_detai = Db::table('cmf_rl_hise_service_pro_cont_detail')->field('hise_service_pro_cont_detail_id,update_time',true)->where('ht_azdbh','not in',$hise_service_project_arr)->where($str)->select()->toArray();
        //首次隐蔽结束的数据
        $hise_service_pro_cont_detai_ycgcwcsj = Db::table('cmf_rl_hise_service_pro_cont_detail')->field('hise_service_pro_cont_detail_id,update_time',true)->where('ht_azdbh','in',$hise_service_project_arr_ycgcwcsj)->select()->toArray();
        //合并首次隐蔽结束和正常查询的数据
        $hise_service_pro_cont_detai = array_merge($hise_service_pro_cont_detai,$hise_service_pro_cont_detai_ycgcwcsj);
        foreach ($hise_service_pro_cont_detai as $key => $value) {
            $hise_service_pro_cont_detai[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
        }
        $arr1 = array_column($hise_service_pro_cont_detai, 'ht_azdbh');
        $hise_service_pro_cont_detai = FunctionService::arraykeyToUPPER($hise_service_pro_cont_detai);

        //获取时间段内的安装节点信息,排除不要的字段,小写转大写
        $hise_service_pro_process = Db::table('cmf_rl_hise_service_pro_process')->field('id,update_time',true)->where('gc_azdid','not in',$hise_service_project_arr)->where($str)->select()->toArray();
        //首次隐蔽结束的数据
        $hise_service_pro_process_ycgcwcsj = Db::table('cmf_rl_hise_service_pro_process')->field('id,update_time',true)->where('gc_azdid','in',$hise_service_project_arr_ycgcwcsj)->select()->toArray();
        //合并首次隐蔽结束和正常查询的数据
        $hise_service_pro_process = array_merge($hise_service_pro_process,$hise_service_pro_process_ycgcwcsj);
        foreach ($hise_service_pro_process as $key => $value) {
            $hise_service_pro_process[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
            $hise_service_pro_process[$key]['jdqrsj'] = date('Y-m-d H:i:s',$value['jdqrsj']);
            $hise_service_pro_process[$key]['azjd'] = $value['azjd_name'];
            $hise_service_pro_process[$key]['cplb'] = $value['product_type'];
            $hise_service_pro_process[$key]['tp_three'] = $value['tp_there'];
        }
        $arr2 = array_column($hise_service_pro_process, 'gc_azdid');
        $hise_service_pro_process = FunctionService::arraykeyToUPPER($hise_service_pro_process);
        
        $hise_service_pro_inst_detail = Db::table('cmf_rl_hise_service_pro_inst_detail')->field('update_time',true)->where('azd_id','not in',$hise_service_project_arr)->where($str)->select()->toArray();
        //首次隐蔽结束的数据
        $hise_service_pro_inst_detail_ycgcwcsj = Db::table('cmf_rl_hise_service_pro_inst_detail')->field('update_time',true)->where('azd_id','in',$hise_service_project_arr_ycgcwcsj)->select()->toArray();
        //合并首次隐蔽结束和正常查询的数据
        $hise_service_pro_inst_detail = array_merge($hise_service_pro_inst_detail,$hise_service_pro_inst_detail_ycgcwcsj);
        foreach ($hise_service_pro_inst_detail as $key => $value) {
            $hise_service_pro_inst_detail[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
            // if($value['sjfhsj'])
            // {
            //     $hise_service_pro_inst_detail[$key]['sjfhsj'] = date('Y-m-d H:i:s',$value['sjfhsj']);
            // }
            if($value['smsj'])
            {
                $hise_service_pro_inst_detail[$key]['smsj'] = date('Y-m-d H:i:s',$value['smsj']);
            }else{
                $hise_service_pro_inst_detail[$key]['smsj'] = '';
            }
        }
        $arr3 = array_column($hise_service_pro_inst_detail, 'azd_id');
        $arrs = array_merge($arr1,$arr2,$arr3);
        $hise_service_pro_inst_detail = FunctionService::arraykeyToUPPER($hise_service_pro_inst_detail);
        //查询这段时间内更新过的项目,排除不要的字段,小写转大写
        
        $hise_service_project = $rlHiseServiceProjectModel->field('hise_service_project_id,update_time',true)->where('gczt','>',2)->where($str)->select()->toArray();
        $hise_service_project_arrs = $rlHiseServiceProjectModel->field('hise_service_project_id,update_time',true)->where('gczt','>',2)->where('azd_id','in',$arrs)->select()->toArray();
        foreach ($hise_service_project as $ke => $va) {
            foreach ($hise_service_project_arrs as $k => $v) {
                if($va['azd_id'] == $v['azd_id'])
                {
                    unset($hise_service_project_arrs[$k]);
                }
            }
        }
        $hise_service_project = array_merge($hise_service_project,$hise_service_project_arrs);
        foreach ($hise_service_project as $key => $value) {
            $hise_service_project[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
            if($value['yyaz_sj']){
                $hise_service_project[$key]['yyaz_sj'] = date('Y-m-d H:i:s',$value['yyaz_sj']);
            }else{
                $hise_service_project[$key]['yyaz_sj'] = '';
            }
            if($value['sjjc_sj']){
                $hise_service_project[$key]['sjjc_sj'] = date('Y-m-d H:i:s',$value['sjjc_sj']);
            }else{
                $hise_service_project[$key]['sjjc_sj'] = '';
            }
            if($value['yyjc_sj']){
                $hise_service_project[$key]['yyjc_sj'] = date('Y-m-d H:i:s',$value['yyjc_sj']);
            }else{
                $hise_service_project[$key]['yyjc_sj'] = '';
            }
            if($value['bx_kssj']){
                $hise_service_project[$key]['bx_kssj'] = date('Y-m-d H:i:s',$value['bx_kssj']);
            }else{
                $hise_service_project[$key]['bx_kssj'] = '';
            }
            if($value['tjrq']){
                $hise_service_project[$key]['tjrq'] = date('Y-m-d H:i:s',$value['tjrq']);
            }else{
                $hise_service_project[$key]['tjrq'] = '';
            }
            if($value['wgbgqr_sj']){
                $hise_service_project[$key]['wgbgqr_sj'] = date('Y-m-d H:i:s',$value['wgbgqr_sj']);
            }else{
                $hise_service_project[$key]['wgbgqr_sj'] = '';
            }
            if($value['tssj']){
                $hise_service_project[$key]['tssj'] = date('Y-m-d H:i:s',$value['tssj']);
            }else{
                $hise_service_project[$key]['tssj'] = '';
            }
            if($value['wgsj']){
                $hise_service_project[$key]['wgsj'] = date('Y-m-d H:i:s',$value['wgsj']);
            }else{
                $hise_service_project[$key]['wgsj'] = '';
            }
            if($value['ycgcwcsj']){
                $hise_service_project[$key]['ycgcwcsj'] = date('Y-m-d H:i:s',$value['ycgcwcsj']);
            }else{
                $hise_service_project[$key]['ycgcwcsj'] = '';
            }
            $hise_service_project[$key]['cplb'] = $value['product_type'];
        }
        $hise_service_project = FunctionService::arraykeyToUPPER($hise_service_project);
        //拼接数组
        $data['HISE_SERVICE_PROJECT'] = $hise_service_project;
        $data['HISE_SERVICE_PRO_CONT_DETAIL'] = $hise_service_pro_cont_detai;
        $data['HISE_SERVICE_PRO_PROCESS'] = $hise_service_pro_process;
        $data['HISE_SERVICE_PRO_INST_DETAIL'] = $hise_service_pro_inst_detail;
        return json([
            "DATA"=>$data,
            "MSG"=>'项目信息同步成功',
            "CODE"=>'S',
        ]);
    }

    //同步单个项目数据
    public function oneitem()
    {
        ini_set('memory_limit','-1');
        set_time_limit(4420);
        //安全验证
        $param = input('param.');
        // $result = $this->cssEncrypt($param);
        // if(!$result)
        // {
            // return json([
            //     "MSG"=>'安全验证失败',
            //     "CODE"=>'S',
            // ]);
        // }
        //获取时间段内修改过的项目
        $azd_id = $param['azd_id'];
        if(!$azd_id)
        {
            return json([
            "DATA"=>[],
            "MSG"=>'请填写安装单号',
            "CODE"=>'S',
        ]);
        }
        $rlHiseServiceProjectModel = new RlHiseServiceProjectModel();

        $hise_service_pro_cont_detai = Db::table('cmf_rl_hise_service_pro_cont_detail')->field('hise_service_pro_cont_detail_id,update_time',true)->where('ht_azdbh',$azd_id)->select()->toArray();
        foreach ($hise_service_pro_cont_detai as $key => $value) {
            $hise_service_pro_cont_detai[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
        }
        $hise_service_pro_cont_detai = FunctionService::arraykeyToUPPER($hise_service_pro_cont_detai);

        //获取时间段内的安装节点信息,排除不要的字段,小写转大写
        $hise_service_pro_process = Db::table('cmf_rl_hise_service_pro_process')->field('id,update_time',true)->where('gc_azdid',$azd_id)->select()->toArray();
        foreach ($hise_service_pro_process as $key => $value) {
            $hise_service_pro_process[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
            $hise_service_pro_process[$key]['jdqrsj'] = date('Y-m-d H:i:s',$value['jdqrsj']);
            $hise_service_pro_process[$key]['azjd'] = $value['azjd_name'];
            $hise_service_pro_process[$key]['cplb'] = $value['product_type'];
            $hise_service_pro_process[$key]['tp_three'] = $value['tp_there'];
        }
        $hise_service_pro_process = FunctionService::arraykeyToUPPER($hise_service_pro_process);
        
        $hise_service_pro_inst_detail = Db::table('cmf_rl_hise_service_pro_inst_detail')->field('update_time',true)->where('azd_id',$azd_id)->select()->toArray();
        foreach ($hise_service_pro_inst_detail as $key => $value) {
            $hise_service_pro_inst_detail[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
            if($value['smsj'])
            {
                $hise_service_pro_inst_detail[$key]['smsj'] = date('Y-m-d H:i:s',$value['smsj']);
            }else{
                $hise_service_pro_inst_detail[$key]['smsj'] = '';
            }
        }
        $hise_service_pro_inst_detail = FunctionService::arraykeyToUPPER($hise_service_pro_inst_detail);
        //查询这段时间内更新过的项目,排除不要的字段,小写转大写
        
        $hise_service_project = $rlHiseServiceProjectModel->field('hise_service_project_id,update_time',true)->where('azd_id',$azd_id)->select()->toArray();
        $hise_service_project = array_merge($hise_service_project);
        foreach ($hise_service_project as $key => $value) {
            $hise_service_project[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
            if($value['yyaz_sj']){
                $hise_service_project[$key]['yyaz_sj'] = date('Y-m-d H:i:s',$value['yyaz_sj']);
            }else{
                $hise_service_project[$key]['yyaz_sj'] = '';
            }
            if($value['sjjc_sj']){
                $hise_service_project[$key]['sjjc_sj'] = date('Y-m-d H:i:s',$value['sjjc_sj']);
            }else{
                $hise_service_project[$key]['sjjc_sj'] = '';
            }
            if($value['yyjc_sj']){
                $hise_service_project[$key]['yyjc_sj'] = date('Y-m-d H:i:s',$value['yyjc_sj']);
            }else{
                $hise_service_project[$key]['yyjc_sj'] = '';
            }
            if($value['bx_kssj']){
                $hise_service_project[$key]['bx_kssj'] = date('Y-m-d H:i:s',$value['bx_kssj']);
            }else{
                $hise_service_project[$key]['bx_kssj'] = '';
            }
            if($value['tjrq']){
                $hise_service_project[$key]['tjrq'] = date('Y-m-d H:i:s',$value['tjrq']);
            }else{
                $hise_service_project[$key]['tjrq'] = '';
            }
            if($value['wgbgqr_sj']){
                $hise_service_project[$key]['wgbgqr_sj'] = date('Y-m-d H:i:s',$value['wgbgqr_sj']);
            }else{
                $hise_service_project[$key]['wgbgqr_sj'] = '';
            }
            if($value['tssj']){
                $hise_service_project[$key]['tssj'] = date('Y-m-d H:i:s',$value['tssj']);
            }else{
                $hise_service_project[$key]['tssj'] = '';
            }
            if($value['wgsj']){
                $hise_service_project[$key]['wgsj'] = date('Y-m-d H:i:s',$value['wgsj']);
            }else{
                $hise_service_project[$key]['wgsj'] = '';
            }
            if($value['ycgcwcsj']){
                $hise_service_project[$key]['ycgcwcsj'] = date('Y-m-d H:i:s',$value['ycgcwcsj']);
            }else{
                $hise_service_project[$key]['ycgcwcsj'] = '';
            }
            $hise_service_project[$key]['cplb'] = $value['product_type'];
        }
        $hise_service_project = FunctionService::arraykeyToUPPER($hise_service_project);
        //拼接数组
        $data['HISE_SERVICE_PROJECT'] = $hise_service_project;
        $data['HISE_SERVICE_PRO_CONT_DETAIL'] = $hise_service_pro_cont_detai;
        $data['HISE_SERVICE_PRO_PROCESS'] = $hise_service_pro_process;
        $data['HISE_SERVICE_PRO_INST_DETAIL'] = $hise_service_pro_inst_detail;
        return json([
            "DATA"=>$data,
            "MSG"=>'项目信息同步成功',
            "CODE"=>'S',
        ]);
    }

        //同步项目数据
    public function inspect()
    {
        ini_set('memory_limit','-1');
        set_time_limit(4420);
        //安全验证
        $param = input('param.');
        // $result = $this->cssEncrypt($param);
        // if(!$result)
        // {
            // return json([
            //     "MSG"=>'安全验证失败',
            //     "CODE"=>'S',
            // ]);
        // }
       //获取时间段内修改过的项目
        $start_time = strtotime($param['start_time']);
        $end_time = strtotime($param['end_time']);
        $str = 'update_time<'.$end_time.' AND update_time>'.$start_time;
        $rlHiseServiceProjectModel = new RlHiseServiceProjectModel();
        //获取一年以内未进入隐蔽结束的安装单号
        $hise_service_project_arr = $rlHiseServiceProjectModel->field('hise_service_project_id,update_time',true)->where('gczt','<',3)->where('update_time','>',time()-86400*360)->column('azd_id');
        //获取时间段内进入隐蔽结束的安装单号
        $strybjs = 'ycgcwcsj<'.$end_time.' AND ycgcwcsj>'.$start_time;
        $hise_service_project_arr_ycgcwcsj = $rlHiseServiceProjectModel->field('hise_service_project_id,update_time',true)->where($strybjs)->column('azd_id');
        $hise_service_project_arr = array_merge($hise_service_project_arr,$hise_service_project_arr_ycgcwcsj);
        //获取时间段内已经提交的巡检单号
        $inspect_codes = Db::table('cmf_rl_inspect')->field('update_time',true)->where('inspect_status',2)->where('azd_id','not in',$hise_service_project_arr)->where($str)->column('inspect_code');
        //首次隐蔽结束的已提交的数据
        $inspect_codes_ycgcwcsj = Db::table('cmf_rl_inspect')->field('update_time',true)->where('inspect_status',2)->where('azd_id','in',$hise_service_project_arr_ycgcwcsj)->column('inspect_code');
        //合并首次隐蔽结束和正常查询的数据
        $inspect_codes = array_merge($inspect_codes,$inspect_codes_ycgcwcsj);
        //获取时间段内修改过的巡检信息,排除不要的字段,小写转大写
        $inspect = Db::table('cmf_rl_inspect')->field('update_time',true)->where('inspect_code','in',$inspect_codes)->where($str)->select()->toArray();
        foreach ($inspect as $key => $value) {
            $inspect[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
            $inspect[$key]['inspect_time'] = date('Y-m-d H:i:s',$value['inspect_time']);
            //是否验证
            if($value['vrct_status'] == 1)
            {
                $inspect[$key]['vrct_status'] = 0;
            }
            if($value['vrct_status'] == 2)
            {
                $inspect[$key]['vrct_status'] = 1;
            }
        }
        $inspect = FunctionService::arraykeyToUPPER($inspect);
        $inspect_score = Db::table('cmf_rl_inspect_score')->field('update_time',true)->where('inspect_code','in',$inspect_codes)->where($str)->select()->toArray();
        foreach ($inspect_score as $key => $value) {
            $inspect_score[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
        }
        $inspect_score = FunctionService::arraykeyToUPPER($inspect_score);
        $inspect_step = Db::table('cmf_rl_inspect_step')->field('update_time',true)->where('inspect_code','in',$inspect_codes)->where($str)->select()->toArray();
        foreach ($inspect_step as $key => $value) {
            $inspect_step[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
        }
        $inspect_step = FunctionService::arraykeyToUPPER($inspect_step);

        $inspect_score_scoring = Db::table('cmf_rl_inspect_score_scoring')->field('update_time',true)->where('inspect_code','in',$inspect_codes)->where($str)->select()->toArray();
        foreach ($inspect_score_scoring as $key => $value) {
            $inspect_score_scoring[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
        }
        $inspect_score_scoring = FunctionService::arraykeyToUPPER($inspect_score_scoring);
        $inspect_step_checking = Db::table('cmf_rl_inspect_step_checking')->field('update_time',true)->where('inspect_code','in',$inspect_codes)->where($str)->select()->toArray();
        foreach ($inspect_step_checking as $key => $value) {
            $inspect_step_checking[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
        }
        $inspect_step_checking = FunctionService::arraykeyToUPPER($inspect_step_checking);
        //拼接数组
        $data['INSPECT'] = $inspect;
        $data['INSPECT_SCORE'] = $inspect_score;
        // $data['INSPECT_SCORE'] = $inspect_score_scoring;
        $data['INSPECT_STEP'] = $inspect_step;
        $data['INSPECT_SCORE_SCORING'] = $inspect_score_scoring;
        $data['INSPECT_STEP_CHECKING'] = $inspect_step_checking;
        return json([
            "DATA"=>$data,
            "MSG"=>'巡检信息同步成功',
            "CODE"=>'S',
        ]);
    }
        /*
     * 校验签名加密方法
     * @param array $query_param 请求参数数组
     * return string $sign 返回加密后的签名
     */
    private function cssEncrypt($query_param){
        ksort($query_param);
        $sign = $query_param['sign'];
        unset($query_param['sign']);
        //加入sign_key
        $tmp_sign = md5(implode($query_param) . md5('_/.(2;l@tx~XvF)`4aZC:f+Q1h<b*&pN%dms#g=q!@#$%^'));
        $tmp_sign = substr($tmp_sign,0,24);
        if($sign === $tmp_sign)
        {
            return true;
        }else{
            return false;
        }
    }

    //返回今天以后两个月的日期['2019年12月12日']
    public function getdate()
    {
        $data = [];
        $number = input('param.number');
        if(!isset($number) || !$number)
        {
            $number  = 30;
        }
        for ($i=0; $i < $number; $i++) { 
            $data[] = date('Y-m-d',time()+$i*86400);
        }
        return json([
            "data"=>$data,
            "msg"=>'成功',
            "code"=>'1',
        ]);
    }
    //修改短信控制
    public function updatemsg(){
        $type = $this->request->param('type');
        $on = $this->request->param('on');
        if(!in_array($type,[1,2,3,4,5,6,7,8,9,10,31,32,33,'star','end']))
        {
            return json(['code'=>0,'msg'=>'参数错误']);
        }
        $installsend = 'installsend'.$type;
            $pats = '/\'' . $installsend . '\'(.*?),/';
            $reps = "'". $installsend. "'". "=>" . "'".$on ."',";
        $fileurl = CMF_ROOT . "api/msgconfig.php";
        $string = file_get_contents($fileurl); //加载配置文件
        $string = preg_replace($pats, $reps, $string); // 正则查找然后替换
        file_put_contents($fileurl, $string); // 写入配置文件
        return json(['code'=>1,'msg'=>'修改成功']);
        
    }
    //获取短信控制
    public function getmsg(){
        $data = [
        'installsend1'=>config('installsend1'),
        'installsend2'=>config('installsend2'),
        'installsend3'=>config('installsend3'),
        'installsend31'=>config('installsend31'),
        'installsend32'=>config('installsend32'),
        'installsend33'=>config('installsend33'),
        'installsend4'=>config('installsend4'),
        'installsend5'=>config('installsend5'),
        'installsend6'=>config('installsend6'),
        'installsend7'=>config('installsend7'),
        'installsend8'=>config('installsend8'),
        'installsend9'=>config('installsend9'),
        'installsend10'=>config('installsend10'),
        'installsendstar'=>config('installsendstar'),
        'installsendend'=>config('installsendend'),
        ];
        return json(['code'=>1,'msg'=>'获取成功','data'=>$data]);
        
    }
    /*
    *2020.9.8生成安装单的节点id数据（修改节点规则，一旦选定分类就固定为当时的节点，不会变化）
     */
    public function azdnodedate()
    {
        $rlHiseServiceProject = new RlHiseServiceProjectModel();
        //获取没有节点信息的安装单数据。每次一万个，循环执行操作
        $data = $rlHiseServiceProject->where('node_ids',1212)->where('zzdpdzt','in','2,3,4,5')->order('create_time desc')->limit(2000)->select();
        // var_dump($data);
        $newlist = [];
        foreach ($data as $key => $value) {
            //如果是隐蔽结束以前的，通过节点配置表获取节点信息保存到安装单
            if($value['gczt']<=3){
                $company = RlEtCompanyModel::where('jxsbm', $value['jxs'])->field('fgs')->find();
                $where = $value['jxs'].','.$company['fgs'].'.'.$value['jxs'].','.'1';
                $list = RlBmNodeRelModel::where('bm','in',$where)->field('node_id')->select();

                $str = '';
                foreach ($list as $k =>$v){
                    if($k==0){
                        $str = $str.$v['node_id'];
                    }else{
                        $str = $str.','.$v['node_id'];
                    }
                }
                $newlist[] = ['hise_service_project_id'=>$value['hise_service_project_id'], 'node_ids'=>$str];
            }
            //如果是隐蔽结束以后的，通过安装单节点信息表获取节点信息保存到安装单
            if($value['gczt']>3){
                $str = Db::table('cmf_rl_hise_service_pro_process')->where('gc_azdid',$value['azd_id'])->column('azjd');
                $str = implode(',', $str);
                $newlist[] = ['hise_service_project_id'=>$value['hise_service_project_id'], 'node_ids'=>$str];
            }
        }
        // var_dump($newlist);
        foreach ($newlist as $key => $value) {
        $reslut = $rlHiseServiceProject->update($value);
        var_dump($reslut);
        }

    }
}
